Developer Documentation

QuickTime 4 API Documentation

QuickTime 4 Reference

| Previous | Chapter Contents | Chapter Top |

The Preview Resource

If your application creates previews, you may want to write them using the data fork format so they can be used on any platform on which QuickTime is available.

The preview display code assumes that the data fork of the file is formatted using QuickTime atoms. See QuickTime File Format Specification, May 1996 for information on atom-based storage.

Adding a preview results in at least two atoms being added to the data file. The first atom has a pnot tag. Its basic structure is the same as the pnotResource structure.

struct PreviewResourceRecord {
    unsigned long       modDate;
    short               version;
    OSType              resType;
    short               resID;
};

Field descriptions

modDate
Contains the modification time (in the standard Macintosh format of seconds since midnight, January 1, 1904) of the file for which the preview was created. This parameter allows you to find out if the preview is out of date with the contents of the file.

version
Contains the version number of the preview resource. The low bit of the version is a flag for preview components that only reference their data. If the bit is set, it indicates that the resource identified in the preview resource is not owned by the preview component, but is part of the file. It is not removed when the preview is updated or removed (using the Image Compression Manager's MakeFilePreview or AddFilePreview function), as it would if the version number were 0.

resType
Identifies the type of the preview component used to display the preview data and the type of the atom containing the preview data.

resID
Contains the index (1-based) of the atom to be used. For example, a resType of PICT and a resID of 2 tells QuickTime to use the second PICT atom in the file for the preview data.


© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top |